const Mock = require("mockjs");
let mongo = require("./mongo");
const data = Mock.mock({
  "memberList|60": [
    {
      "id|+1": 1,
      //   "name|2": "小梦",
      //   "num|3": "5",
      //   "num2|1-6": 1,
      name: "@cname",
      //   price: "@int",
      //   status: "@boolean",
      birthday: '@date("yyyy/MM/dd")',
      sex: /男|女/,
      phone: /1[3-9]\d{9}/,
      address: "@county(true)", // 省市县
      pic: "@image(50×60)",
      email: "@email",
      //   title: "@ctitle(8, 20)",
      //   content: "@csentence(200, 500)",

      //   area: "@region", // 区域

      //   zipCode: "@zip", // 邮政编码
    },
  ],
});

// stringify(数据, 数据转换函数，缩进空格数)
console.log(JSON.stringify(data, null, 2));
//查看效果，执行命令 node demo1.js

//转存到数据库里面
mongo.insert({
  colname: "user",
  data: data.memberList,
});
